home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 80 / CD Actual 80 Julio-Agosto 2003.iso / Linux / LinuxGazette / lg / issue14 / misc / supermount.README < prev   
Encoding:
Text File  |  2002-08-14  |  5.4 KB  |  142 lines

  1. Supermount README
  2. =================
  3.  
  4. For supermount v0.4
  5.  
  6. Supermount is a pseudo-filesystem which manages filesystems on
  7. removable media like floppy disks and CD-ROMs.  It aims to make
  8. management of removable media as easy as it is under DOS.
  9.  
  10. With supermount, you can change the disk in the drive whenever you
  11. want (with the obvious exception that you shouldn't do it when the
  12. filesystem is actively in use).  You don't need to "cd" out of the
  13. directory first, and you don't need to tell the kernel what you're
  14. doing --- supermount will detect the media change automatically.
  15.  
  16. Supermount will automatically detect whether the media you are
  17. mounting is read-write or readonly, and if you mount a write-protected
  18. disk, then the subfs will be mounted as a readonly filesystem.
  19.  
  20. Supermount detects when you have finished activity on the subfs, and
  21. will flush all buffers to the disk before completing the operation.
  22. So, if you copy a file onto a supermounted floppy disk, the data will
  23. all be written to disk before the "cp" command finishes.  When the
  24. command does complete, it will be safe to remove the disk.
  25.  
  26. It is worth while defining what I mean by "activity" here.  The subfs
  27. is active if there are any processes running which have a handle on a
  28. non-directory inode on the subfs, or which have a file open on the
  29. subfs (even if only for reading).  There is one important case which
  30. does NOT count as activity: if you "cd" to a directory or a
  31. subdirectory under the supermount mount point, then that reference
  32. does not make the subfs active, and you can safely remove the disk.
  33.  
  34. Yes, that's right.  You can "cd /floppy; ls" and get a listing of a
  35. dos floppy.  Remove the disk, insert a new one, and "ls" will now list
  36. the new contents.  Remove the disk altogether, and "ls" will give you
  37. an I/O error.  Put in a new disk, and "ls" starts working again.  It
  38. is NOT an error to remove a supermounted disk which is acting as the
  39. current working directory for one or more processes!
  40.  
  41.  
  42. The Superfilesystem and Subfilesystem concepts
  43. ----------------------------------------------
  44.  
  45. Normally, when you mount a filesystem, you create a direct connection
  46. between a mount point in the directory tree and a filesystem on a
  47. block device.  Supermount adds an extra layer in between; with
  48. supermount, you explicitly mount the pseudo-filesystem (the
  49. "superfilesystem") on the mount point, and supermount then
  50. automatically mounts the real filesystem (the "subfilesystem") on the
  51. block device when needed.
  52.  
  53. Running supermount
  54. ------------------
  55.  
  56. To run supermount, compile and install a kernel with the supermount
  57. patches and select "Y" to the question
  58.  
  59.     Dynamic mounting of removable media?
  60.  
  61. when you run "make config".  You set up a supermount filesystem with
  62. the normal mount command, using the syntax:
  63.  
  64.     mount -o <superfs-options>,--,<subfs-options> / <mount-point>
  65.  
  66. Notice that I specified "/" instead of giving a block device to
  67. supermount.  This is because the supermount filesystem is NOT
  68. connected to a block device; rather, supermount is responsible for
  69. connecting a separate filesystem to the block device.  You specify
  70. this by providing the <superfs-options> field, where the following
  71. options are currently recognised:
  72.  
  73. * subfs=<filesystem-type>        [default is "msdos"]
  74.  
  75.     Specify the subfilesystem type.  "msdos" and "iso9660" have
  76. been tested, but any block-device filesystem should work with one
  77. important restriction: the filesystem must NOT try to write to the
  78. device when you unmount it.  This is because supermount doesn't know
  79. in advance when it will have to unmount the subfs, so it doesn't try
  80. to do so until it detects that the media has been changed.  By this
  81. time it is too late to write to the device!
  82.  
  83.     If you mount supermount as a readonly filesystem ("mount -r"
  84. or "mount -o ro"), then you won't have this problem.  Otherwise, you
  85. will not be able to use the ext2fs or minix filesystems with
  86. supermount.  This will hopefully be addressed in a future release of
  87. supermount.
  88.  
  89. * dev=<block-device>            [default is "/dev/fd0"]
  90.  
  91.     Specify the block device on which the subfs is to be mounted.
  92.  
  93. * debug
  94.  
  95.     Enable debugging code in the supermount filesystem, if
  96. the debug option was enabled at compile time.  By default, debugging
  97. code is compiled into the kernel but is disabled until a debug mount
  98. option is seen.
  99.  
  100. * '--'
  101.  
  102.     All options after the option string '--' will be passed
  103. directly to the subfilesystem when it gets mounted.
  104.  
  105.  
  106. Here is an example of supermount options, taken directly out of my
  107. current /etc/fstab:
  108.  
  109. / /floppy    supermount    --,gid=51,conv=binary    0 0
  110. / /cd        supermount    ro,fs=iso9660,dev=/dev/hdd,--,conv=binary 0 0
  111.  
  112. This tells supermount to manage a msdos filesystem on /dev/fd0 mounted
  113. at /floppy (msdos and /dev/fd0 are defaults for supermount), with the
  114. msdos filesystem getting the options "gid=51,conv=binary".  My cdrom
  115. on /dev/hdd is similarly mounted on /cd.
  116.  
  117.  
  118. Enjoy supermount.  I hope you find it useful --- I certainly find it
  119. extremely convenient.  Send any comments, bug-fixes or bug-reports,
  120. suggestions and success stories to sct@dcs.ed.ac.uk.  Flames to
  121. /dev/null, please!
  122.  
  123. Cheers,
  124.  Stephen.
  125. --
  126. Stephen Tweedie <sct@dcs.ed.ac.uk>
  127. Department of Computer Science, Edinburgh University, Scotland.
  128.  
  129.  
  130. ================================================================
  131. Changes for v0.4:
  132. Performance tuning only.  Read-only operations like "find" should now
  133. be MUCH faster.
  134.  
  135. Changes for v0.3:
  136. Fixed supermount_create bug; now returns a properly attached
  137. superinode.
  138.  
  139. Changes for v0.2:
  140. Improved device invalidation code, so CD-ROMs work now.
  141.  
  142.